Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Hold a reference to the Skia unref queue in UIDartState#13239

Merged
jason-simmons merged 1 commit into
flutter-team-archive:masterfrom
jason-simmons:io_thread_skia_queue_2
Oct 21, 2019
Merged

Hold a reference to the Skia unref queue in UIDartState#13239
jason-simmons merged 1 commit into
flutter-team-archive:masterfrom
jason-simmons:io_thread_skia_queue_2

Conversation

@jason-simmons

Copy link
Copy Markdown
Contributor

Obtaining the SkiaUnrefQueue through the IOManager is unsafe because
UIDartState has a weak pointer to the IOManager that can not be dereferenced
on the UI thread.

@Hixie

Hixie commented Oct 18, 2019

Copy link
Copy Markdown
Contributor

test?

@chinmaygarde chinmaygarde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool. I really like this pattern in shell setup. Thanks @gaaclarke for the idea.

You can close flutter/flutter#42946 too.

@jason-simmons

Copy link
Copy Markdown
Contributor Author

The thread safety property involved here is validated by the weak pointer thread checker (see #12257).

When the thread checker was reenabled, a workaround was added toUIDartState that unsafely accessed the SkiaUnrefQueue to avoid triggering the assertions (see https://github.com/flutter/engine/pull/12257/files#diff-5d704fecf8a6d80591469004049997f0R82). This PR removes the workaround and returns a SkiaUnrefQueue without violating any thread safety checks.

Obtaining the SkiaUnrefQueue through the IOManager is unsafe because
UIDartState has a weak pointer to the IOManager that can not be dereferenced
on the UI thread.
@jason-simmons jason-simmons force-pushed the io_thread_skia_queue_2 branch from 4dab82f to 0b8e8a1 Compare October 19, 2019 00:09

@gw280 gw280 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jason-simmons jason-simmons merged commit 4ecfa62 into flutter-team-archive:master Oct 21, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Oct 22, 2019
git@github.com:flutter/engine.git/compare/8882bf3c73f5...39e6901

git log 8882bf3..39e6901 --no-merges --oneline
2019-10-21 iska.kaushik@gmail.com Add recipe changelog (flutter-team-archive/engine#13270)
2019-10-21 jonahwilliams@google.com fix NPE in accessibility bridge (flutter-team-archive/engine#13255)
2019-10-21 skia-flutter-autoroll@skia.org Roll src/third_party/skia 9889d509ed9f..56f569d9bec2 (21 commits) (flutter-team-archive/engine#13266)
2019-10-21 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from hc4p_... to hALu4... (flutter-team-archive/engine#13252)
2019-10-21 mouad.debbar@gmail.com [web] Support input action (flutter-team-archive/engine#13268)
2019-10-21 mouad.debbar@gmail.com [web] Support -j to use goma in felt build (flutter-team-archive/engine#13259)
2019-10-21 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from 30Ua7... to _e7Up... (flutter-team-archive/engine#13254)
2019-10-21 jason-simmons@users.noreply.github.com Hold a reference to the Skia unref queue in UIDartState (flutter-team-archive/engine#13239)
2019-10-21 jason-simmons@users.noreply.github.com Do not attempt to drain the SkiaUnrefQueue in the destructor (flutter-team-archive/engine#13237)
2019-10-21 bkonyi@google.com Updated license script to ignore testdata directories, which often contain object files and other compilation results (flutter-team-archive/engine#13261)
2019-10-21 iska.kaushik@gmail.com Add templates to generate fuchsia host bundles (flutter-team-archive/engine#13158)
2019-10-21 garyq@google.com Update ui.instantiateImageCodec docs to reflect what it does. (flutter-team-archive/engine#13233)
2019-10-21 hterkelsen@users.noreply.github.com Update CanvasKit to 0.7.0 and flesh out painting (flutter-team-archive/engine#13240)
2019-10-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from CYDvx... to 30Ua7... (flutter-team-archive/engine#13251)
2019-10-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from 0JpMS... to hc4p_... (flutter-team-archive/engine#13250)
2019-10-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from bdTv5... to CYDvx... (flutter-team-archive/engine#13249)
2019-10-19 skia-flutter-autoroll@skia.org Roll src/third_party/skia c65eb34d2f37..9889d509ed9f (1 commits) (flutter-team-archive/engine#13248)
2019-10-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from SevlL... to 0JpMS... (flutter-team-archive/engine#13244)
2019-10-19 skia-flutter-autoroll@skia.org Roll src/third_party/skia 7605c89c00f7..c65eb34d2f37 (3 commits) (flutter-team-archive/engine#13243)
2019-10-19 bkonyi@google.com Ignore *.obj files when gathering licenses (flutter-team-archive/engine#13241)
2019-10-18 garyq@google.com Roll buildroot to 994c6 (flutter-team-archive/engine#13236)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC franciscojma@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
git@github.com:flutter/engine.git/compare/8882bf3c73f5...39e6901

git log 8882bf3..39e6901 --no-merges --oneline
2019-10-21 iska.kaushik@gmail.com Add recipe changelog (flutter-team-archive/engine#13270)
2019-10-21 jonahwilliams@google.com fix NPE in accessibility bridge (flutter-team-archive/engine#13255)
2019-10-21 skia-flutter-autoroll@skia.org Roll src/third_party/skia 9889d509ed9f..56f569d9bec2 (21 commits) (flutter-team-archive/engine#13266)
2019-10-21 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from hc4p_... to hALu4... (flutter-team-archive/engine#13252)
2019-10-21 mouad.debbar@gmail.com [web] Support input action (flutter-team-archive/engine#13268)
2019-10-21 mouad.debbar@gmail.com [web] Support -j to use goma in felt build (flutter-team-archive/engine#13259)
2019-10-21 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from 30Ua7... to _e7Up... (flutter-team-archive/engine#13254)
2019-10-21 jason-simmons@users.noreply.github.com Hold a reference to the Skia unref queue in UIDartState (flutter-team-archive/engine#13239)
2019-10-21 jason-simmons@users.noreply.github.com Do not attempt to drain the SkiaUnrefQueue in the destructor (flutter-team-archive/engine#13237)
2019-10-21 bkonyi@google.com Updated license script to ignore testdata directories, which often contain object files and other compilation results (flutter-team-archive/engine#13261)
2019-10-21 iska.kaushik@gmail.com Add templates to generate fuchsia host bundles (flutter-team-archive/engine#13158)
2019-10-21 garyq@google.com Update ui.instantiateImageCodec docs to reflect what it does. (flutter-team-archive/engine#13233)
2019-10-21 hterkelsen@users.noreply.github.com Update CanvasKit to 0.7.0 and flesh out painting (flutter-team-archive/engine#13240)
2019-10-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from CYDvx... to 30Ua7... (flutter-team-archive/engine#13251)
2019-10-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from 0JpMS... to hc4p_... (flutter-team-archive/engine#13250)
2019-10-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from bdTv5... to CYDvx... (flutter-team-archive/engine#13249)
2019-10-19 skia-flutter-autoroll@skia.org Roll src/third_party/skia c65eb34d2f37..9889d509ed9f (1 commits) (flutter-team-archive/engine#13248)
2019-10-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from SevlL... to 0JpMS... (flutter-team-archive/engine#13244)
2019-10-19 skia-flutter-autoroll@skia.org Roll src/third_party/skia 7605c89c00f7..c65eb34d2f37 (3 commits) (flutter-team-archive/engine#13243)
2019-10-19 bkonyi@google.com Ignore *.obj files when gathering licenses (flutter-team-archive/engine#13241)
2019-10-18 garyq@google.com Roll buildroot to 994c6 (flutter-team-archive/engine#13236)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC franciscojma@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

5 participants